import uuid
from django.contrib.auth.models import AbstractUser
from django.db import models

class Users(AbstractUser):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    username = models.CharField(max_length=50, unique=True)
    email = models.EmailField(unique=True)
    ip_address = models.GenericIPAddressField(null=True)
    last_login = models.DateTimeField(blank=True, null=True)

    def __str__(self):
        return self.username
